% data is from
% http://archive.ics.uci.edu/ml/datasets/Congressional+Voting+Records
fid = fopen('house-votes-84.csv', 'r');
D = 17;
linenum = 1;
while 1
  tline = fgetl(fid);
  if ~ischar(tline), break, end
  disp(tline)
  s=regexp(tline, ',', 'split');
  switch s{1}
    case 'republican',
      data.X(linenum, 1) = 1;
    case 'democrat'
      data.X(linenum, 1) = 2;
    otherwise
      data.X(linenum, 1) = nan;
  end
  for i=2:17
    switch s{i}
      case 'n'
        data.X(linenum, i) = 1;
      case 'y'
        data.X(linenum, i) = 2;
        otherwise
        data.X(linenum, i) = nan;
    end
  end
  linenum = linenum + 1;
end
fclose(fid);

data.names = {'party', ...
  'handicapped-infants', ...
  'water-project-cost-sharing', ...
  'adoption-of-the-budget-resolution', ...
  'physician-fee-freeze', ... 
  'el-salvador-aid', ... 
  'religious-groups-in-schools', ...
  'anti-satellite-test-ban', ...
  'aid-to-nicaraguan-contras', ...
  'mx-missile', ...
  'immigration', ...
  'synfuels-corporation-cutback', ...
  'education-spending', ...
  'superfund-right-to-sue', ... 
  'crime', ... 
  'duty-free-exports', ...
  'export-administration-act-south-africa'};

data.vals = {'republican/democrat', 'n/y'};
